from selenium import webdriver

from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.common.exceptions import UnexpectedAlertPresentException
from selenium.webdriver.chrome.options import Options
from time import sleep
import datetime

class Base():
    def __init__(self, *, isProxy=True):
      
        options = Options()
        if isProxy:
           
            # options.add_argument("--headless")
            prefs = {"profile.managed_default_content_settings.images": 1}
            options.add_experimental_option("prefs", prefs)
            options.add_argument('--proxy-server=http://127.0.0.1:9000')
            options.add_argument('disable-infobars')
            options.add_argument('--no-sandbox')


        self.driver = webdriver.Chrome(options=options)
       
        self.driver.maximize_window()
      
        self.driver.implicitly_wait(5)
   